const getSystemInfo = () => {
	return new Promise((resolve, reject) => {
		uni.getSystemInfo({
			success: (res) => {
				console.log('设备信息获取成功！', res);
				resolve(res);
			},
			fail:(error) => {
				console.error('设备信息获取失败！', error);
				reject(error);
			},
			complete: (res) => {
				console.log('获取设备信息结束！', res);
			}
		})
	})
}

const getNetworkType = () => {
	return new Promise((resolve, reject) => {
		uni.getNetworkType({
			success: (res) => {
				console.log('网络信息获取成功！', res.networkType);
				resolve(res);
			},
			fail:(error) => {
				console.error('网络信息获取失败！', error);
				reject(error);
			},
			complete: (res) => {
				console.log('获取网络信息结束！', res);
			}
		})
	})
}


module.exports =  {
	getSystemInfo,
	getNetworkType
}